<%@page pageEncoding="UTF-8" contentType="text/html; UTF-8" isELIgnored="false" %>
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>编辑博客</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
        }

        body {
            background: linear-gradient(135deg, #fae18e 0%, #e4edf5 100%);
            min-height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 20px;
        }

        .article-card {
            width: 100%;
            max-width: 700px;
            background: white;
            border-radius: 16px;
            box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
            overflow: hidden;
            animation: fadeIn 0.6s ease-out;
        }

        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(20px); }
            to { opacity: 1; transform: translateY(0); }
        }

        .card-header {
            background: linear-gradient(135deg, #f69577 0%, #ff7a5c 100%);
            color: white;
            padding: 30px;
            text-align: center;
            position: relative;
            overflow: hidden;
        }

        .card-header::before {
            content: "";
            position: absolute;
            top: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            background: radial-gradient(circle, transparent 20%, rgba(255,255,255,0.15) 20%, rgba(255,255,255,0.15) 21%, transparent 21%);
            background-size: 50px 50px;
            transform: rotate(30deg);
            z-index: 0;
        }

        .header-content {
            position: relative;
            z-index: 1;
        }

        .card-header h1 {
            font-size: 2.2rem;
            margin-bottom: 10px;
            letter-spacing: 1px;
        }

        .card-header p {
            font-size: 1.1rem;
            opacity: 0.9;
        }

        .card-body {
            padding: 35px;
        }

        .form-group {
            margin-bottom: 25px;
        }

        .form-group label {
            display: block;
            margin-bottom: 10px;
            font-weight: 600;
            color: #2b2d42;
            font-size: 1.05rem;
            display: flex;
            align-items: center;
        }

        .form-group label i {
            margin-right: 10px;
            color: #f69577;
            font-size: 1.2rem;
        }

        .input-field {
            width: 100%;
            padding: 15px 18px;
            border: 2px solid #e2e8f0;
            border-radius: 12px;
            font-size: 1rem;
            transition: all 0.3s ease;
            background: #f8fafc;
        }

        .input-field:focus {
            border-color: #f69577;
            outline: none;
            box-shadow: 0 0 0 4px rgba(246, 149, 119, 0.2);
            background: white;
        }

        textarea.input-field {
            min-height: 200px;
            resize: vertical;
        }

        .submit-btn {
            display: block;
            width: 100%;
            background: linear-gradient(135deg, #f69577 0%, #ff7a5c 100%);
            color: white;
            border: none;
            padding: 16px;
            font-size: 1.1rem;
            font-weight: 600;
            border-radius: 12px;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 5px 15px rgba(246, 149, 119, 0.35);
            position: relative;
            overflow: hidden;
            z-index: 1;
        }

        .submit-btn::after {
            content: "";
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(135deg, #ff7a5c 0%, #f69577 100%);
            opacity: 0;
            transition: all 0.4s ease;
            z-index: -1;
        }

        .submit-btn:hover {
            transform: translateY(-3px);
            box-shadow: 0 8px 20px rgba(246, 149, 119, 0.45);
        }

        .submit-btn:hover::after {
            opacity: 1;
        }

        .submit-btn:active {
            transform: translateY(1px);
        }

        .submit-btn i {
            margin-right: 8px;
        }

        .character-count {
            text-align: right;
            font-size: 0.9rem;
            color: #64748b;
            margin-top: -10px;
            margin-bottom: 15px;
        }

        @media (max-width: 768px) {
            .article-card {
                max-width: 100%;
            }

            .card-header {
                padding: 25px 20px;
            }

            .card-header h1 {
                font-size: 1.8rem;
            }

            .card-body {
                padding: 25px 20px;
            }
        }

        @media (max-width: 480px) {
            body {
                padding: 15px;
            }

            .card-header {
                padding: 20px 15px;
            }

            .card-header h1 {
                font-size: 1.6rem;
            }

            .card-header p {
                font-size: 0.95rem;
            }

            .input-field {
                padding: 12px 15px;
                font-size: 0.95rem;
            }
        }
    </style>
</head>
<body>
<div class="article-card">
    <div class="card-header">
        <div class="header-content">
            <h1>编辑博客</h1>
        </div>
    </div>

    <div class="card-body">
        <form action="edit" method="post">
            <input type="hidden" name="id" value="${article.id}">

            <div class="form-group">
                <label for="title"><i class="fas fa-heading"></i> 文章标题</label>
                <input type="text" id="title" name="title" class="input-field" value="${article.title}" required>
            </div>

            <div class="form-group">
                <label for="author"><i class="fas fa-user"></i> 作者</label>
                <input type="text" id="author" name="author" class="input-field" value="${article.author}" required>
            </div>

            <div class="form-group">
                <label for="content"><i class="fas fa-align-left"></i> 文章内容</label>
                <textarea id="content" name="content" class="input-field" required>${article.content}</textarea>
            </div>

            <button type="submit" class="submit-btn">
                <i class="fas fa-paper-plane"></i> 发布文章
            </button>
        </form>
    </div>
</div>

<script>
    // 表单提交动画
    const form = document.querySelector('form');
    form.addEventListener('submit', function() {
        const submitBtn = document.querySelector('.submit-btn');
        submitBtn.innerHTML = '<i class="fas fa-spinner fa-spin"></i> 发布中...';
        submitBtn.disabled = true;
    });
</script>
</body>
</html>